package com.fortune.service;

import com.fortune.entity.COrderPolicy;
import com.fortune.vo.cOrder.*;
import com.fortune.vo.wechatProduct.VendorListVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface COrderService {
    /**
     * 获取厂商列表
     * @return
     */
    List<VendorListVo> findVendorListVoList(String dealerId);

    /**
     * 查询是否当前经销商存在自营产品
     * @param dealerId
     * @return
     */
    String findAcountDid(String dealerId);

    /**
     * 查询商品列表
     * @return
     */
    List<ClientOrderProduct> findListOrderProductInfo(String mid);

    /**
     * 根据商品查询优惠
     * @param mid
     * @param mpid
     * @return
     */
    COrderPolicy findListCOrderPolicy(String mid,String mpid);

    /**
     * 添加订单
     * @return
     */
    int addCOrder(String did,String clientId,String id,String no,BigDecimal pTotalPrice,BigDecimal dTotalPrice);

    /**
     * 添加订单详情
     * @param mid
     * @param did
     * @param clientId
     * @param id
     * @param detailsNo
     * @param productId
     * @param orderNum
     * @param unitPrice
     * @param backBoxNum
     * @param dprice
     * @return
     */
    int addCOrderDetails(String did,String clientId,String id,int detailsNo,String mid,String productId,
                         float orderNum,BigDecimal price,String policyId,BigDecimal unitPrice,
                         float backBoxNum,BigDecimal dprice,BigDecimal tprice);

    /**
     * 添加订单详情
     * @param mid
     * @param did
     * @param clientId
     * @param id
     * @param detailsNo
     * @param productId
     * @param orderNum
     * @param unitPrice
     * @param backBoxNum
     * @param dprice
     * @return
     */
    int addCOrderDetailsByZS(String did,String clientId,String id,int detailsNo,String mid,String productId,
                             float orderNum,BigDecimal price,String policyId,BigDecimal unitPrice,
                             float backBoxNum,BigDecimal dprice,BigDecimal tprice);

    /**
     *
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    int editOrder(String did,String clientId,String orderId,BigDecimal pTotalPrice,BigDecimal dTotalPrice);

    /**
     * 删除订单
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    int delOrder(String did,String clientId,String orderId);

    /**
     * 查询客户对应的经销商
     * @param clientId
     * @return
     */
    String findClientDid(@Param("clientId") String clientId);

    /**
     * 订单详情
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    ClientOrderDetail findClientOrderDetail(@Param("did") String did,
                                            @Param("clientId") String clientId,
                                            @Param("orderId") String orderId);

    /**
     * 已出库订单详情
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    ClientOrderDetail findClientOrderDetailByCk(@Param("did") String did,
                                                @Param("clientId") String clientId,
                                                @Param("orderId") String orderId);

    /**
     * 已收货订单详情
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    ClientOrderDetails findClientOrderDetailsBySH(@Param("did") String did,
                                                  @Param("clientId") String clientId,
                                                  @Param("orderId") String orderId);

    /**
     * 已完成订单详情
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    ClientOrderDetails findClientOrderDetailsByWC(@Param("did") String did,
                                                    @Param("clientId") String clientId,
                                                    @Param("orderId") String orderId);

    /**
     * 删除订单
     * @param did
     * @param clientId
     * @param orderId
     * @return
     */
    int deleteCOrder(@Param("did") String did,
                     @Param("clientId") String clientId,
                     @Param("orderId") String orderId);

    /**
     * 查询未处理的列表
     * @param did
     * @param clientId
     * @return
     */
    List<ClientCOrderDetails> findListClientOrder(@Param("did") String did,
                                                  @Param("clientId") String clientId);

    /**
     * 查询已批准的列表
     * @param did
     * @param clientId
     * @return
     */
    List<ClientOrder> findListClientOrderByApproved(@Param("did") String did,
                                                    @Param("clientId") String clientId);

    /**
     * 查询发货的列表
     * @param did
     * @param clientId
     * @return
     */
    List<ClientOrder> findListClientOrderByShipped(@Param("did") String did,
                                                   @Param("clientId") String clientId);

    /**
     * 查询已收货的列表
     * @param did
     * @param clientId
     * @return
     */
    List<ClientOrder> findListClientOrderByreceived(@Param("did") String did,
                                                    @Param("clientId") String clientId);

    /**
     * 查询已完成的列表
     * @param did
     * @param clientId
     * @return
     */
    List<ClientOrder> findListClientOrderByCompleted(@Param("did") String did,
                                                     @Param("clientId") String clientId);

    /**
     * 查询商品列表
     * @param mid
     * @return
     */
    List<WorkOrderList> findWorkOrderListList(@Param("mid") String mid);

    /**
     * 查询当前客户所有订单0
     * @param did
     * @param clientId
     * @return
     */
    List<DDCOrder> findDDCOrderList(@Param("did") String did,
                                    @Param("clientId") String clientId);

    /**
     * 查询当前客户所有订单1
     * @param did
     * @param clientId
     * @return
     */
    List<DDCOrder> findDDCOrderListByApproved(@Param("did") String did,
                                              @Param("clientId") String clientId);

    /**
     * 查询当前客户所有订单2
     * @param did
     * @param clientId
     * @return
     */
    List<DDCOrder> findDDCOrderListByShipped(@Param("did") String did,
                                              @Param("clientId") String clientId);

    /**
     * 查询当前客户所有订单3
     * @param did
     * @param clientId
     * @return
     */
    List<DDCOrder> findDDCOrderListByreceived(@Param("did") String did,
                                              @Param("clientId") String clientId);

    /**
     * 查询当前客户所有订单4
     * @param did
     * @param clientId
     * @return
     */
    List<DDCOrder> findDDCOrderListByCompleted(@Param("did") String did,
                                              @Param("clientId") String clientId);

    /**
     * 查询订单详情
     * @param did
     * @param clientId
     * @param cOrderId
     * @return
     */
    List<DDCOrderDetail> findDDCOrderDetailList(@Param("did") String did,
                                                @Param("clientId") String clientId,
                                                @Param("cOrderId") String cOrderId);

    /**
     * 修改客户回访周期
     * @param did
     * @param clientId
     * @return
    */
    int editClientHFTime(String did,String clientId, String returnPeriod);

    /**
     * 查询回访周期
     * @param did
     * @param clientId
     * @return
     */
    String findReturnPeriod(String did,String clientId);
}
